using MyAutoMapper.Profile;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddSwaggerGen();

// 添加AutoMapper服务
builder.Services.AddSingleton(Profile.MapperService()); 

var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.MapControllers();
app.Run();

// https://mp.weixin.qq.com/s/S692IjFTOCE8wrNz0lwm1A
// 添加AutoMapper包
// dotnet add package AutoMapper
// dotnet add package AutoMapper.Extensions.Microsoft.DependencyInjection